package com.github.livebase.event;

import androidx.annotation.NonNull;

/**
 * @ClassName Event
 * @description:
 * @author: biao532
 * @create: 2023-12-25 19:21
 * @Version 1.0
 **/
public class Event {
    private String eventId;
    private Object data;
    public Event(String eventId, Object data) {
        this.eventId = eventId;
        this.data = data;
    }
    public Event(String eventId) {
        this(eventId, null);
    }
    public String getEventId() {
        return this.eventId;
    }

    public<T> T getAttachObject() {
        return (T) this.data;
    }

    public static boolean isEvent(Event event, @NonNull String eventId) {
        return eventId.equals(event.eventId);
    }
}
